package com.demo.base.web.webmvc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.MethodParameter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter;

import java.lang.reflect.Type;

/**
 */
@ControllerAdvice
public class UrlEncodedFormRequestBodyAdvice extends RequestBodyAdviceAdapter {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public boolean supports(MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
        return UrlEncodedFormRequestBodyHttpMessageConverter.class.isAssignableFrom(aClass);
    }
}
